package cn.fate.core.controller.basic;


import cn.fate.core.common.ResponseBean;
import cn.fate.core.dao.basic.entity.Staff;
import cn.fate.core.service.basic.StaffService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xubo
 * @since 2021-09-14
 */
@RestController
@RequestMapping("/online")
public class OnlineController {

    @Autowired
    private StaffService staffService;

    @GetMapping(value = "/test", produces = "application/json;charset=UTF-8")
    public ResponseBean test(@RequestParam String staffNo){
        QueryWrapper<Staff> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("staff_no",staffNo);
        Staff staff = staffService.getOne(queryWrapper);
        return ResponseBean.success(staff);
    }
    @GetMapping(value = "/testTwo", produces = "application/json;charset=UTF-8")
    public ResponseBean testTwo(@RequestParam String staffNo){
        QueryWrapper<Staff> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("staff_no",staffNo);
        Staff staff = staffService.getOne(queryWrapper);
        return ResponseBean.success(staff);
    }
}

